import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  base:"./",
  // publicDir: resolve(__dirname, './dist'),
  // assetsInclude:resolve(__dirname,'./src/assets'),
  plugins: [vue()],
 
  resolve: {
    alias: [{
        find: "@",
        replacement: resolve(__dirname, './src')
      }, {
        find: "components",
        replacement: resolve(__dirname, 'src/components')
      }, {
        find: "vites",
        replacement: resolve(__dirname, 'src/view')
      }]
  },
  server: {
   
    host: '0.0.0.0',
    port: 3000,
    // 是否开启 https
    https: false,
    proxy: {
      '/api': {
        // target: "http://127.0.0.1:4523/m1/2510743-0-default",// 赵
        // target: "http://127.0.0.1:4523/m1/2510743-0-default/api", // 田
        target: "http://127.0.0.1:4523/m1/2510743-0-default/api", // 艾
        changeOrigin: true,
        rewrite:path=>path.replace(/^\/api/,'')
      },
      '/base': {
        // target: "http://10.10.0.201:8219", //开发环境
        target: "http://114.116.13.1:8219", // 测试环境
        changeOrigin: true,
        rewrite:path=>path.replace(/^\/base/,'')
      }
    }
  },
  build: {
    sourcemap:false
  }
})
